package com.gitee.base.modules.core.model;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName("sys_user")
public class SysUser {

    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

    @TableField(value = "username")
    private String username;

    @TableField(value = "password")
    private String password;

    @TableField(value = "nickname")
    private String nickname;

    @TableField(value = "email")
    private String email;

    /**
     * 角色列表
     */
    @TableField(value = "role_ids")
    private String roleIds;

    @TableField(value = "ctime", fill = FieldFill.INSERT)
    private LocalDateTime ctime;//创建时间

    @TableField(value = "cid", fill = FieldFill.INSERT)
    private Integer cid = 0;//创建人，0：系统

    @TableField("status")
    private Short status;//0:正常，1：锁定

    @TableField(value = "deleted")
    private Boolean deleted = false;

    //非数据库字段
    @TableField(exist = false)
    private String roleNames;
}
